package com.neural.learning.rule;


public enum RuleManager {
	
	DELTA_RULE("delta", new DeltaRule()),
	WIDROWHOFF_RULE("widrowHoff", new WidrowHoffRule());
	
	private RuleManager(String name, LearningRule rule) {
		this.name = name;
		this.rule = rule;
	}
	
	public static LearningRule getLearningRuleFromName(String name) {
		for(RuleManager ruleManager : values()) {
			if(ruleManager.name.equals(name)) {
				return ruleManager.rule;
			}
		}
		return null;
	}
	
	private final String name;
	private final LearningRule rule;
}
